/*
 * @Author: EltonLi lijiaming@uavi-tech.com
 * @Date: 2023-08-30 17:06:18
 * @LastEditors: LVGRAPE
 * @LastEditTime: 2024-12-24 10:56:01
 * @FilePath: \zino-fc-v4\applications\main.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE[]
 */
/*
 * Copyright (c) 2006-2023, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2023-08-30     RT-Thread    first version
 */

#include <rtthread.h>
#ifdef ARDUINO
// #include "fc_error.h"
// #include "arduino.h"
// #include "program.h"
#endif

#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include <rtdbg.h>
#include <rtdevice.h>
#include "zino.h"

extern void setup(void);
extern void loop(void);

int main(void)
{
    rt_device_t vcom = rt_device_find("vcom");
    if(vcom != RT_NULL)
    {
        rt_console_set_device("vcom");
        // rt_err_t ret = rt_device_open(vcom, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_INT_TX);
        // if(ret == RT_EOK)
        // {
        //     LOG_I("vcom device open success");
        // }
        // else
        // {
        //     LOG_E("vcom device open failed");
        // }
    }
    else
    {
        LOG_E("vcom device not found");
    }
    while(1)
    {
        // rt_kprintf("rtk Hello RT-Thread! %d\n", millis());
        // rt_device_write(vcom, 0, "uHello RT-Thread! ", 19);
        rt_thread_mdelay(1000);
    }
    return RT_EOK;
}
